   // 当前激活的副作用函数
   var activeEffect
   // 存放副作用函数的桶
   var bucket = new WeakMap() //[proxy: [a:Set([fn,fn,fn,....]),b:Set([fn,fn,fn,fn....])],p2: [a:Set([fn,fn,fn,....]),b:Set([fn,fn,fn,fn....])]]

   // 收集依赖
   function effect(fn) {
     activeEffect = fn
     fn()
     activeEffect = null
   }

   function track(target, key) {
     if (!activeEffect) return
     let depMap = bucket.get(target)
     if (!depMap) {
       depMap = new Map()
       bucket.set(target, depMap)
     }

     let depSet = depMap.get(key)
     if (!depSet) {
       depSet = new Set()
       depMap.set(key, depSet)
     }
     depSet.add(activeEffect)
   }

   function trigger(target,key){
    let depMap = bucket.get(target)
    if(!depMap) return
    let depSet = depMap.get(key)
    depSet.forEach(fn => fn())
   }

   function reactive(data) {
     if (!(typeof data === 'object' && data !== null)) return
     return new Proxy(data, {
       get(target, key) {
        // track 追踪依赖
         track(target, key)
         return target[key]
       },
       set(target, key, value) {
         target[key] = value
         trigger(target,key)
         return true
       }
     })
   }